<template>
	<view class="container">
		<!-- Logo -->
		<view class="logo-container">
			<image class="logo" src="/static/log.png" mode="aspectFit"></image>
		</view>

		<!-- 名称和版本号 -->
		<view class="app-info">
			<text class="app-name">明渠智侧</text>
			<text class="app-version">v{{versi}}</text>
		</view>

		<!-- 检查更新（绿色文字） -->
		<view class="check-update-text" @click="uplodeFn">
			<text>检查更新</text>
		</view>

		<!-- 信息卡片 -->
		<view class="info-card">
			<view class="info-item">
				<image class="item-icon" src="/static/lianxiwmaa.png"></image>
				<view class="item-content">
					<text class="item-title">当前版本：</text>
					<text class="item-value">V{{versi}}</text>
				</view>
			</view>

			<view class="divider"></view>

			<view class="info-item">
				<image class="item-icon" src="/static/lianxiwmbb.png"></image>
				<view class="item-content">
					<text class="item-title">版权所有：</text>
					<text class="item-value">河北浩水科技有限公司</text>
				</view>
			</view>

			<view class="divider"></view>

			<view class="info-item">
				<image class="item-icon" src="/static/lianxiwmcc.png"></image>
				<view class="item-content">
					<text class="item-title">联系我们：</text>
					<text class="item-value">15130638952</text>
				</view>
			</view>
		</view>

		<!-- 底部备案信息 -->
		<view class="footer">
			<text>冀ICP备16009060号-4A</text>
		</view>
		<!-- 更新 -->
		<wrap-version-update ref="updateref" :auto="false" :loading="false" id="582639319765061" @finish="landleFinish"
			@check="landlecheck"></wrap-version-update>
		<!-- 更新 -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				versi: '',
			}
		},
		methods: {
			//版本号
			landlecheck(e) {
				this.versi = e.version
			},
			// 手动更新
			uplodeFn() {
				this.$refs.updateref.check()
			},
			// 已经最新
			landleFinish() {
				uni.showToast({
					title: '已经是最新版本'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		flex-direction: column;
		padding: 40rpx;
		background-color: #ffffff;
		min-height: 80vh;

		.logo-container {
			display: flex;
			justify-content: center;
			margin: 60rpx 0 40rpx;

			.logo {
				width: 150rpx;
				height: 150rpx;
				border-radius: 40rpx;
				box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.1);
			}
		}

		.app-info {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-bottom: 30rpx;

			.app-name {
				font-size: 44rpx;
				font-weight: bold;
				color: #333;
				margin-bottom: 12rpx;
			}

			.app-version {
				font-size: 32rpx;
				color: #999;
			}
		}

		.check-update-text {
			font-size: 36rpx;
			color: #09BE4F;
			text-align: center;
			margin-bottom: 60rpx;
			font-weight: 500;
			padding: 20rpx 0;

			&:active {
				opacity: 0.8;
			}
		}

		.info-card {
			.info-item {
				display: flex;
				align-items: center;
				padding: 30rpx 0;

				.item-icon {
					width: 44rpx;
					height: 44rpx;
					margin-right: 25rpx;
					flex-shrink: 0;
				}

				.item-content {
					flex: 1;
					display: flex;
					align-items: center;

					.item-title {
						font-size: 30rpx;
						color: #999;
						width: 150rpx;
						flex-shrink: 0;
					}

					.item-value {
						font-size: 34rpx;
						color: #333;
						font-weight: 500;
						flex: 1;
					}
				}
			}

			.divider {
				height: 1rpx;
				background: #f0f0f0;
				margin-left: 70rpx;
			}
		}

		.footer {
			position: absolute;
			bottom: 40rpx;
			left: 0;
			right: 0;
			text-align: center;
			font-size: 28rpx;
			color: #585858;
		}
	}
</style>
<style>
	page {
		background-color: #ffffff;
	}
</style>